package main.笔试真题.美团2021秋招;

import java.util.Scanner;

public class meituan001 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n= in.nextInt();
        String[] accounts=new String[n];
        in.nextLine();
        for (int i=0;i<n;i++) {
            String s = in.nextLine();
            accounts[i]=s;
        }
        Solution solution = new Solution();
        String[] process = solution.process(accounts);
        for (String str:process) System.out.println(str);
    }
}
class Solution{
    public String[] process(String[] strings) {
        String[] result=new String[strings.length];
        for (int i=0;i< strings.length;i++) {
            if (check(strings[i])) {
                result[i]="Accept";
            }else result[i]="Wrong";
        }
        return result;
    }
    public boolean check(String account) {
        int charCount=0,numCount=0;
        for (int i=0;i<account.length();i++) {
            if (i==0) {
                if (!((account.charAt(i)>='a'&&account.charAt(i)<='z')||(account.charAt(i)>='A'&&account.charAt(i)<='Z'))) return false;
                charCount++;
            }else {
                if ((account.charAt(i)>='a'&&account.charAt(i)<='z')||(account.charAt(i)>='A'&&account.charAt(i)<='Z')) charCount++;
                else if (account.charAt(i)>='0'&&account.charAt(i)<='9') numCount++;
                else return false;
            }
        }
        if (charCount<1||numCount<1) return false;
        return true;
    }
}